package code.module.userList
{
	import code.common.assets.AssetsClassName;
	
	import com.yy.manager.ResourceManager;
	import com.yy.ui.controls.TabButton;
	import com.yy.yyui.ButtonGroup;
	import com.yy.yyui.table.Table;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	import ui.question.SelectBtn;
	
	/**
	 *好友列表 、房间用户列表 
	 * @author YY
	 * 
	 */
	public class UserListView extends Sprite
	{
		private var _viewUi:MovieClip;
		private var _friendUserBtn:TabButton;
		private var _roomUserBtnBtn:TabButton;
		private var _btnContainer:Sprite;
		public function UserListView()
		{
			super();
			var dobj:DisplayObject;
			_viewUi = ResourceManager.getMovieClipByName(AssetsClassName.UserListUi);
			dobj = addChild(_viewUi);
			_btnContainer = new Sprite();
			addChild(_btnContainer);
			
			var oldX:int = _viewUi.tab0.x;
			var oldY:int = _viewUi.tab0.y;
			_viewUi.tab0.x = 0;
			_viewUi.tab0.y = 0;
			_friendUserBtn = new TabButton(_viewUi.tab0);
			dobj = _btnContainer.addChild(_friendUserBtn);
			dobj.x = oldX;
			dobj.y = oldY;
			oldX = _viewUi.tab1.x;
			oldY = _viewUi.tab1.y;
			_viewUi.tab1.x = 0;
			_viewUi.tab1.y = 0;
			_roomUserBtnBtn = new TabButton(_viewUi.tab1);
			dobj = _btnContainer.addChild(_roomUserBtnBtn);
			dobj.x = oldX;
			dobj.y = oldY;
		}
		
		public function showUserList():void {
			
		}
		
		/**
		 *显示按钮状态 
		 * @param friendBoo true:好友按钮状态  	false:房间列表按钮状态
		 * 
		 */
		public function showBtnState(friendBoo:Boolean=true):void {
			if(friendBoo) {
				_friendUserBtn.select = true;
				_roomUserBtnBtn.select = false;
				_btnContainer.addChildAt(_roomUserBtnBtn, 0);
			}else {
				_friendUserBtn.select = false;
				_roomUserBtnBtn.select = true;
				_btnContainer.addChildAt(_friendUserBtn, 0);
			}
		}
		
	}
}